package com.zbkj.service.service.order;

import com.zbkj.dal.base.enums.ShareOrderLogTypeEnums;
import com.zbkj.service.model.front.req.log.ShareOrderLogCreateReq;
import com.zbkj.service.model.front.vo.log.ShareOrderLogVO;

import java.util.List;

/**
 * @author wangzhengyan
 * @date 2024/4/6 2:25 PM
 */
public interface ShareOrderOperateLogService {

    /**
     * 添加日志
     *
     * @param req
     */
    Boolean addLog(ShareOrderLogCreateReq req);

    /**
     * 添加日志
     *
     * @param orderNo  订单号
     * @param type     类型
     * @param nickname 用户昵称
     * @return 结果
     */
    default Boolean addLog(String orderNo, ShareOrderLogTypeEnums type, String nickname) {
        ShareOrderLogCreateReq req = new ShareOrderLogCreateReq();
        req.setOperateType(type.getName());
        req.setOrderNo(orderNo);
        req.setOperateContent(nickname + type.getText());
        return addLog(req);
    }

    /**
     * 获取日志操作列表
     *
     * @param orderNo 订单号
     * @return List<ShareOrderLogVO>
     */
    List<ShareOrderLogVO> getLogList(String orderNo);

    ShareOrderLogVO getOneLog(String orderNo, ShareOrderLogTypeEnums operateType);
}
